﻿@model Zatify.WebUI.Models.BusinessProfilePaymentViewModel
@{
    ViewBag.Title = "Profile - Payment Information";
    ViewBag.ContentTitle = "Profile - Payment Information";
    Layout = "~/Views/Shared/_ContentLayout.cshtml";
}
@section Styles
{
    <style type="text/css">
        .inner_container
        {
            float: none;
        }
    </style>
}
@section Scripts
{
    <script type="text/javascript">

        $(document).ready(function () {

            $("#CreditCardPin").val('@Model.CreditCardPin');

            $('#BillingUse').change(function () {

                setBillingAddress($(this).attr("checked"));
            });
        });

        function setBillingAddress(isBillingAddress) {

            var billingAddress1 = $('#BillingAddress1');
            var billingAddress2 = $('#BillingAddress2');
            var billingCity = $('#BillingCity');
            var billingStateCode = $('#BillingStateCode');
            var billingZipCode = $('#BillingZipCode');

            if (isBillingAddress) {

                billingAddress1.attr('readonly', 'readonly');
                billingAddress2.attr('readonly', 'readonly');
                billingCity.attr('readonly', 'readonly');
                billingStateCode.attr('disabled', 'disabled');
                billingZipCode.attr('readonly', 'readonly');

                billingAddress1.val($('#BusinessAddress1').val());
                billingAddress2.val($('#BusinessAddress2').val());
                billingCity.val($('#BusinessCity').val());
                billingStateCode.val($('#BusinessStateCode').val());
                billingZipCode.val($('#BusinessZipCode').val());
            }
            else {

                billingAddress1.removeAttr('readonly');
                billingAddress2.removeAttr('readonly');
                billingCity.removeAttr('readonly');
                billingStateCode.removeAttr('disabled');
                billingZipCode.removeAttr('readonly');

                billingAddress1.val('');
                billingAddress2.val('');
                billingCity.val('');
                billingStateCode.val('1');
                billingZipCode.val('');
            }
        }
    </script>
}
<div class="business_interface_area">
    @using (Html.BeginForm())
    {
        @Html.HiddenFor(m => m.BusinessAddress1)
        @Html.HiddenFor(m => m.BusinessAddress2)
        @Html.HiddenFor(m => m.BusinessCity)
        @Html.HiddenFor(m => m.BusinessStateCode)
        @Html.HiddenFor(m => m.BusinessZipCode)
        <div class="business_profile_hours">
            <h6>
                Payment Information:</h6>
            <p>
                <img alt="" src="@Url.Content("~/Content/zatify/images/payment_img.png")" style="margin-bottom: 20px;" /></p>
            <div class="payment_credit_debit_card">
                Visa Cards:</div>
            <!--<div class="enter_card_info">Enter your card information</div>-->
            <div class="line">
                <label for="cardno" class="label_text left_align">
                    Card number :</label>
                @Html.TextBoxFor(x => x.CreditCardNo, new { @class = "inputbox_text inputbox_bg_img40" })
            </div>
            <div class="line">
                <label for="nameoncard" class="label_text left_align">
                    Name on Card :</label>
                @Html.TextBoxFor(x => x.CreditCardName, new { @class = "inputbox_text inputbox_bg_img40" })
            </div>
            <div class="line">
                <label for="expirationdate" class="label_text left_align">
                    Expiration date :</label>
                @Html.DropDownListFor(m => m.CreditCardExpirationMonth, (IEnumerable<SelectListItem>)ViewData["Months"], new { @class = "select_inputbox_text select_inputbox_date select_inputbox_date_img40" })
                @Html.DropDownListFor(m => m.CreditCardExpirationYear, (IEnumerable<SelectListItem>)ViewData["Years"], new { @class = "select_inputbox_text select_inputbox_years select_inputbox_years_img40" })
            </div>
            <div class="line">
                <label for="pincode" class="label_text left_align">
                    PIN/Secure Code :</label>
                @Html.PasswordFor(x => x.CreditCardPin, new { @class = "inputbox_text inputbox_bg_img40" })
            </div>
            <div class="clearfix">
            </div>
            <div class="">
                <div class="enter_card_info" style="margin-top: 20px;">
                    Billing Address
                    <!--<br /> <span class="for_credit_card_only">(for Credit Cards only)</span>-->
                    <label style="float: right;">
                        @Html.CheckBoxFor(m => m.BillingUse)
                        User Business Address
                    </label>
                </div>
            </div>
            <div class="clearfix">
            </div>
            <div class="line">
                <label for="streetadress" class="label_text left_align">
                    Street Address :</label>
                @if (Model.BillingUse)
                {
                    @Html.TextBoxFor(x => x.BillingAddress1, new { @class = "inputbox_text inputbox_bg_img40", @readonly = "readonly" })
                }
                else
                {
                    @Html.TextBoxFor(x => x.BillingAddress1, new { @class = "inputbox_text inputbox_bg_img40" })
                }
            </div>
            <div class="line">
                <label for="streetadress2" class="label_text left_align">
                    Street Address 2 :</label>
                @if (Model.BillingUse)
                {
                    @Html.TextBoxFor(x => x.BillingAddress2, new { @class = "inputbox_text inputbox_bg_img40", placeholder = "(Optional)", @readonly = "readonly" })
                }
                else
                {
                    @Html.TextBoxFor(x => x.BillingAddress2, new { @class = "inputbox_text inputbox_bg_img40", placeholder = "(Optional)" })
                }
            </div>
            <div class="line">
                <label for="city" class="label_text left_align">
                    City :</label>
                @if (Model.BillingUse)
                {
                    @Html.TextBoxFor(x => x.BillingCity, new { @class = "inputbox_text inputbox_bg_img40", @readonly = "readonly" })
                }
                else
                {
                    @Html.TextBoxFor(x => x.BillingCity, new { @class = "inputbox_text inputbox_bg_img40" })
                }
            </div>
            <div class="line">
                <label for="state" class="label_text left_align">
                    State :</label>
                @if (Model.BillingUse)
                {
                    @Html.DropDownListFor(m => m.BillingStateCode, (IEnumerable<SelectListItem>)ViewData["USStates"], new { @class = "select_inputbox_text select_inputbox_bg_img40", disabled = "disabled" })
                }
                else
                {
                    @Html.DropDownListFor(m => m.BillingStateCode, (IEnumerable<SelectListItem>)ViewData["USStates"], new { @class = "select_inputbox_text select_inputbox_bg_img40" })
                }
            </div>
            <div class="line">
                <label for="zipcode" class="label_text left_align">
                    Zip Code :</label>
                @if (Model.BillingUse)
                {
                    @Html.TextBoxFor(x => x.BillingZipCode, new { @class = "inputbox_text inputbox_bg_img40", @readonly = "readonly" })
                }
                else
                {
                    @Html.TextBoxFor(x => x.BillingZipCode, new { @class = "inputbox_text inputbox_bg_img40" })
                }
            </div>
            <div class="clearfix">
            </div>
            <input type="submit" value="Save" class="blue_btn" style="margin-left: 0px;">
        </div>
        @Html.ValidationSummary()
        <div class="clearfix">
        </div>
    }
</div>
